<?php 
// +----------------------------------------------------------------------
// | RXThinkCMF_EVTP5.1_PRO前后端分离旗舰版框架 [ RXThinkCMF ]
// +----------------------------------------------------------------------
// | 版权所有 2018~2021 南京RXThinkCMF研发中心
// +----------------------------------------------------------------------
// | 官方网站: http://www.rxthink.cn
// +----------------------------------------------------------------------
// | 作者: ZhangXuanNeng <rxthinkcmf@163.com>
// +----------------------------------------------------------------------
// | 免责声明:
// | 本软件框架禁止任何单位和个人用于任何违法、侵害他人合法利益等恶意的行为，禁止用于任何违
// | 反我国法律法规的一切平台研发，任何单位和个人使用本软件框架用于产品研发而产生的任何意外
// | 、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、附带
// | 或衍生的损失等)，本团队不承担任何法律责任。本软件框架只能用于公司和个人内部的法律所允
// | 许的合法合规的软件产品研发，详细声明内容请阅读《框架免责声明》附件；
// +----------------------------------------------------------------------

namespace app\admin\controller;


use app\admin\service\BoxNotMediaOrderService;
use app\common\controller\Export;

/**
 * 订单列管理-控制器
 * @author ZhangXuanNeng
 * @since: 2023/07/25
 * Class Order
 * @package app\admin\controller
 */
class BoxNotMediaOrder extends Backend
{
    /**
     * 初始化方法
     * @author ZhangXuanNeng
     * @since: 2023/07/25
     */
    public function initialize()
    {
        parent::initialize(); // TODO: Change the autogenerated stub
        $this->service = new BoxNotMediaOrderService();
    }
    public function export(){
        $param = request()->param();

        // 查询条件
        $map = [];
        $map[] = ['pay_status', '=', 1];
        if(isset($param['member_id']) && !empty($param['member_id'])){
            $map[] = ['member_id','=',$param['member_id']];
        }
        if(isset($param['member_account']) && !empty($param['member_account'])){
            $map[] = ['member_account','=',$param['member_account']];
        }
        if(isset($param['package_id']) && !empty($param['package_id'])){
            $map[] = ['package_id','=',$param['package_id']];
        }
        if(isset($param['promote_id']) && !empty($param['promote_id'])){
            $map[] = ['promote_id','=',$param['promote_id']];
        }
        if(isset($param['role_id']) && !empty($param['role_id'])){
            $map[] = ['role_id','=',$param['role_id']];
        }
        if(isset($param['pay_game_status']) && !empty($param['pay_game_status'])){
            $map[] = ['pay_game_status','=',$param['pay_game_status']];
        }
        if(isset($param['pay_way']) && !empty($param['pay_way'])){
            $map[] = ['pay_way','=',$param['pay_way']];
        }
        if(isset($param['pay_time']) && !empty($param['pay_time'])){
            $map[] = ['pay_time','between time',$param['pay_time']];
        }
        if(isset($param['pay_order_number']) && !empty($param['pay_order_number'])){
            $map[] = ['pay_order_number','=',$param['pay_order_number']];
        }
        $Export = new Export();
        $Export->expUser(1,$map);
    }

    public function gamePayNotify(){
        $result = $this->service->gamePayNotify();
        return $this->jsonReturn($result);
    }
    // 生成导出队列
    public function exportQueue(){
        $result = $this->service->exportQueue();
        return $this->jsonReturn($result);
    }
                                                                                                                                            
}